package pers.li.controller.goods;


import pers.li.model.Goods;
import pers.li.service.GoodsService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@WebServlet("/goods/saleGoods.action")
public class SalesController extends HttpServlet {
    private final GoodsService goodsService = new GoodsService();

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        List<Goods> hotGoods = goodsService.getHotGoods(12);
        req.setAttribute("hotGoods", hotGoods);
        req.getRequestDispatcher("/goods/sale_goods.jsp").forward(req, resp);
    }
}
